cask "emclient" do
  version "7.2.37965"
  sha256 "3d8e9f7714143adacfcc8256c45beebaae58256a813eb56f46cf3d44d772103f"

  url "https://cdn-dist.emclient.com/dist/v#{version}_Mac/setup.pkg"
  appcast "https://www.emclient.com/release-history?os=mac"
  name "eM Client"
  homepage "https://www.emclient.com/"

  auto_updates true

  pkg "setup.pkg"

  uninstall pkgutil: "com.emclient.mail.client.pkg"

  zap trash: [
    "~/Library/Caches/com.emclient.mail.client",
    "~/Library/Preferences/com.emclient.mail.client.plist",
    "~/Library/Preferences/com.emclient.mail.repair.plist",
    "~/Library/Preferences/com.emclient.mail.shared.plist",
    "~/Library/Saved Application State/com.emclient.mail.client.savedState",
  ]
end
